<?php

use app\middleware\SystemMiddleware;
use think\facade\Route;

Route::group("sys", function () {
    Route::post("login", "sys.Admin/login");
    Route::get("check_login", "sys.Admin/check")->middleware([SystemMiddleware::class]);
    Route::get("check_auth", "sys.Admin/auth")->middleware([SystemMiddleware::class]);
    Route::get("order_static", "sys.Index/orderStatic")->middleware([SystemMiddleware::class]);
    Route::get("order_pie_static", "sys.Index/orderMonth")->middleware([SystemMiddleware::class]);
    Route::get("order_today_static", "sys.Index/orderDay")->middleware([SystemMiddleware::class]);
    Route::group("img", function () {
        Route::get("list", "sys.Image/lst");
        Route::post("delete", "sys.Image/delete");
    })->middleware([SystemMiddleware::class]);
    Route::group("admin", function () {
        Route::post("modify", "sys.Admin/modify");
    })->middleware([SystemMiddleware::class]);
    Route::group("merchant", function () {
        Route::post("save", "sys.mer/save");
        Route::get("list", "sys.mer/lst");
        Route::get("detail", "sys.mer/detail");
        Route::post("balance", "sys.mer/balance");
        Route::post("state", "sys.mer/state");
        Route::post("allState", "sys.mer/allState");
        Route::get("search", "sys.mer/search");
        Route::get("bindSearch", "sys.mer/bindSearch");
    })->middleware([SystemMiddleware::class]);
    Route::group("merchant_balance", function () {
        Route::get("list", "sys.MerBalance/lst");
        Route::any("download", "sys.MerBalance/download");
    })->middleware([SystemMiddleware::class]);
    Route::group("station", function () {
        Route::post('save', "sys.Station/save");
        Route::get('list', "sys.Station/lst");
        Route::get('detail', "sys.Station/detail");
        Route::post('series', "sys.Station/series");
        Route::post('state', "sys.Station/state");
        Route::get('city', "sys.Station/city");
        Route::post('task_save', "sys.Station/task_save");
        Route::get('task_list', "sys.Station/task_list");
        Route::post('printTest', "sys.Station/printer_test");
    })->middleware([SystemMiddleware::class]);
    Route::group("supplier", function () {
        Route::post('save', "sys.Supplier/save");
        Route::get('list', "sys.Supplier/lst");
        Route::get('detail', "sys.Supplier/detail");
        Route::get('hasStation', "sys.Supplier/searchStation");
        Route::get('station', "sys.Supplier/station");
        Route::post('addStation', "sys.Supplier/addStation");
        Route::post("updatePrice","sys.Supplier/price");
        Route::post("deleteStation","sys.Supplier/deleteStation");
    })->middleware([SystemMiddleware::class]);
    Route::group("order", function () {
        Route::get('list', "sys.Order/lst");
        Route::any('download', "sys.Order/download");
        Route::post("cancel","sys.Order/cancel");
        Route::post("review","sys.Order/review");
        Route::post("refund","sys.Order/refund");
        Route::get("static","sys.Order/orderStatic");
        Route::get("print","sys.Order/orderPrint");
    })->middleware([SystemMiddleware::class]);
    Route::group("role", function () {
        Route::get('list', "sys.Role/lst");
        Route::post("save","sys.Role/save");
        Route::get("detail","sys.Role/detail");
        Route::get("search","sys.Role/search");
    })->middleware([SystemMiddleware::class]);
    Route::group("sale",function (){
        Route::post("save","sys.Sale/save");
        Route::get('list','sys.Sale/lst');
        Route::get("detail","sys.Sale/detail");
    })->middleware([SystemMiddleware::class]);
});
Route::post("upload/file/image", "upload/images");
